﻿using DH.Core.MapperHelper;
using DH.Core.UI.ViewModel;
using DH.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace DH.Service.ViewModels
{
    [MapToType(typeof(UserEntity))]
    public class UserViewModel:EntityModelBase
    {
        /// <summary>
        /// 账号
        /// </summary>
        public string DH_Account { get; set; }
        /// <summary>
        /// 姓名
        /// </summary>
        public string DH_RealName { get; set; }
        /// <summary>
        /// 昵称/展示名
        /// </summary>
        public string DH_NickName { get; set; }

        /// <summary>
        /// 头像
        /// </summary>
        public string DH_HeadIcon { get; set; }
        /// <summary>
        /// 性别
        /// </summary>
        public bool? DH_Gender { get; set; }

        public DateTimeOffset? DH_Birthday { get; set; }

        public string Birthday {
            get {
                var formateDate = "";
                if (DH_Birthday!=null)
                {
                    formateDate=((DateTimeOffset)DH_Birthday).ToString("yyyy-MM-dd");
                }
                return formateDate;
            }
            set {
                var dateStr = value;
                var date = DateTimeOffset.Parse(dateStr);
                DH_Birthday=date;
            }
        }

        public string DH_MobilePhone { get; set; }

        public string DH_Email { get; set; }

        public string DH_WeChat { get; set; }

        /// <summary>
        /// 安全级别
        /// </summary>
        public int? DH_SecurityLevel { get; set; }
        /// <summary>
        /// 个性签名
        /// </summary>
        public string DH_Signature { get; set; }

        public string DH_OrganizeId { get; set; }
        public string DH_DepartmentId { get; set; }

        
        public string Organizations {
            get
            {
                return OrgName;
            }
            set
            {
                OrgName = value;
                
            }
        }
        

        
        public string OrganizationIds {
            get {
                return DH_OrganizeId;
            }
            set {
                DH_OrganizeId = value;
            }
        }

        public string DH_RoleId { get; set; }
        /// <summary>
        /// 岗位
        /// </summary>
        public string DH_DutyId { get; set; }

        public bool? DH_IsAdministrator { get; set; }

        public bool DH_IsDeveloper { get; set; }

        /// <summary>
        ///删除标志
        /// </summary>
        public bool? DH_DeleteMark { get; set; }
        /// <summary>
        /// 有效标志
        /// </summary>
        public bool? DH_EnableMark { get; set; }

        public string DH_Description { get; set; }

        public string DH_UserPass { get; set; }

        //public DateTimeOffset CreatedOn { get; set; }
        //public string CreatedBy { get; set; }


        //public DateTimeOffset UpdatedOn { get; set; }
        //public string UpdatedBy { get; set; }

        //public DateTimeOffset? DeletedOn { get; set; }
        //public string DeletedBy { get; set; }

        public string IndexId { get; set; }
        public string OrgName { get; set; }



    }
}
